import { Handlers } from "$fresh/server.ts";
import { Package } from "$classes/package.ts";
export const handler: Handlers = {
async GET(_req, ctx) {
const _package = await Package.FindByPath(ctx.url.pathname.replace('/api/v1/packages/', ''));
if(!_package) throw new Deno.errors.NotFound;
return Response.json(await _package.Clean());
}
};